package com.settlement.system.model.vo;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.format.NumberFormat;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 原始抖音订单导入对象
 *
 * @author haoxr
 * @since 2022/4/10
 */
@Data
public class TbOrderImportVo {
    @ExcelProperty(value = "订单编号")
    private String orderNo;

    @ExcelProperty(value = "支付单号")
    private String payNo;

    @ExcelProperty(value = "支付详情")
    private String payDetail;

    @ExcelProperty(value = "买家应付货款")
    private String buyerDuePayAmount;

    @ExcelProperty(value = "买家应付邮费")
    private String buyerDuePayPostage;

    @ExcelProperty(value = "买家支付积分")
    private String buyerPayCredits;

    @ExcelProperty(value = "总金额")
    private String totalAmount;

    @ExcelProperty(value = "返点积分")
    private String returnCredits;

    @ExcelProperty(value = "买家实际支付金额")
    private String buyerActualPayAmount;

    @ExcelProperty(value = "买家实际支付积分")
    private String buyerActualPayCredits;

    @ExcelProperty(value = "订单状态")
    private String orderStatus;

    @ExcelProperty(value = "买家留言")
    private String buyerMessage;

    @ExcelProperty(value = "收货人名称")
    private String receiverName;

    @ExcelProperty(value = "收货地址")
    private String recieverAddress;

    @ExcelProperty(value = "运送方式")
    private String deliveryMethod;

    @ExcelProperty(value = "联系电话")
    private String mobile;

    @ExcelProperty(value = "联系手机")
    private String phone;

    @ExcelProperty(value = "虚拟号过期时间")
    private String virtualNoExpireTime;

    @ExcelProperty(value = "订单创建时间")
    @DateTimeFormat("yyyy-MM-dd HH:mm:ss")
    private LocalDateTime orderCreateTime;

    @ExcelProperty(value = "订单付款时间")
    private String orderPayTime;

    @ExcelProperty(value = "宝贝标题")
    private String goodsTitle;

    @ExcelProperty(value = "宝贝种类")
    private String goodsType;

    @ExcelProperty(value = "物流单号")
    private String logisticsNo;

    @ExcelProperty(value = "物流公司")
    private String logisticsCompany;

    @ExcelProperty(value = "订单备注")
    private String remark;

    @ExcelProperty(value = "宝贝总数量")
    private Integer goodsNum;

    @ExcelProperty(value = "店铺Id")
    private String storeId;

    @ExcelProperty(value = "店铺名称")
    private String storeName;

    @ExcelProperty(value = "订单关闭原因")
    private String orderCloseReason;

    @ExcelProperty(value = "卖家服务费")
    private String sellerServiceFee;

    @ExcelProperty(value = "买家服务费")
    @NumberFormat("#.##元")
    private BigDecimal buyerServiceFee;

    @ExcelProperty(value = "发票抬头")
    private String invoiceTitle;

    @ExcelProperty(value = "是否手机订单")
    private String mobileOrder;

    @ExcelProperty(value = "分阶段订单信息")
    private String stepOrderInfo;

    @ExcelProperty(value = "特权订金订单id")
    private String privilegeOrderId;

    @ExcelProperty(value = "是否上传合同照片")
    private String hasUploadContract;

    @ExcelProperty(value = "是否上传小票")
    private String hasUploadReceipt;

    @ExcelProperty(value = "是否代付")
    private String hasPayBehalf;

    @ExcelProperty(value = "定金排名")
    private String depositRank;

    @ExcelProperty(value = "修改后的sku")
    private String newSku;

    @ExcelProperty(value = "修改后的收获地址")
    private String newRecieveAddress;

    @ExcelProperty(value = "异常信息")
    private String exceptionMessage;

    @ExcelProperty(value = "天猫卡券抵扣")
    private String tmallDeduct;

    @ExcelProperty(value = "集分宝抵扣")
    private String jfbDeduct;

    @ExcelProperty(value = "是否是O2O交易")
    private String o2oTrade;

    @ExcelProperty(value = "新零售交易类型")
    private String newTradeType;

    @ExcelProperty(value = "新零售导购门店名称")
    private String newTradeName;

    @ExcelProperty(value = "新零售导购门店id")
    private String newTradeId;

    @ExcelProperty(value = "新零售发货门店名称")
    private String newTradeDeliveryName;

    @ExcelProperty(value = "新零售发货门店id")
    private String newTradeDeliveryId;

    @ExcelProperty(value = "退款金额")
    private String returnAmount;

    @ExcelProperty(value = "预约门店")
    private String bookingStore;

    @ExcelProperty(value = "确认收货时间")
    private String receiveTime;

    @ExcelProperty(value = "打款商家金额")
    @NumberFormat("#.##元")
    private BigDecimal paySellerAmount;

    @ExcelProperty(value = "含应开票给个人的个人红包")
    private String invoiceTip;

    @ExcelProperty(value = "是否信用购")
    private String hasCreditBuy;

    @ExcelProperty(value = "体验期结束时间")
    private String experienceEndTime;

    @ExcelProperty(value = "前N有礼")
    private String aheadPresent;

    @ExcelProperty(value = "配送类型")
    private String deliveryType;

    @ExcelProperty(value = "直播返现状态")
    private String liveReturnStatus;

    @ExcelProperty(value = "返现金额")
    private String cashbackAmount;

    @ExcelProperty(value = "延迟发货赔付金额")
    private String delayPayAmount;

    @ExcelProperty(value = "新零售成交门店昵称")
    private String newDealStoreName;

    @ExcelProperty(value = "新零售成交门店id")
    private String newDealStoreId;

    @ExcelProperty(value = "新零售成交经销商id")
    private String newDealAgentId;

    @ExcelProperty(value = "预售订单")
    private String presaleOrder;

    @ExcelProperty(value = "发货时间")
    private String deliveryTime;

    @ExcelProperty(value = "主订单编号")
    private String mainOrderNum;

    @ExcelProperty(value = "补差订单")
    private String differentOrder;

    public static List<String> getBigDecimalColumn() {
        List<String> columnList = new ArrayList<>();
        columnList.add("buyerDuePayAmount");
        columnList.add("buyerDuePayPostage");
        columnList.add("buyerPayCredits");
        columnList.add("totalAmount");
        columnList.add("returnCredits");
        columnList.add("buyerActualPayAmount");
        columnList.add("buyerActualPayCredits");
        columnList.add("sellerServiceFee");
        columnList.add("buyerServiceFee");
        columnList.add("returnAmount");
        columnList.add("paySellerAmount");
        columnList.add("cashbackAmount");
        columnList.add("delayPayAmount");
        return columnList;
    }

    public static List<String> getColumns() {
        List<String> columns = new ArrayList<>();
        columns.add("订单编号");
        columns.add("支付单号");
        columns.add("支付详情");
        columns.add("买家应付货款");
        columns.add("买家应付邮费");
        columns.add("买家支付积分");
        columns.add("总金额");
        columns.add("返点积分");
        columns.add("买家实际支付金额");
        columns.add("买家实际支付积分");
        columns.add("订单状态");
        columns.add("买家留言");
        columns.add("收货人名称");
        columns.add("收货地址");
        columns.add("运送方式");
        columns.add("联系电话");
        columns.add("联系手机");
        columns.add("虚拟号过期时间");
        columns.add("订单创建时间");
        columns.add("订单付款时间");
        columns.add("宝贝标题");
        return columns;
    }

    public static Map<String, String> getKeyMap() {
        Map<String, String> map = new HashMap<>();
        map.put("订单编号", "orderNo");
        map.put("支付单号", "payNo");
        map.put("支付详情", "payDetail");
        map.put("买家应付货款", "buyerDuePayAmount");
        map.put("买家应付邮费", "buyerDuePayPostage");
        map.put("买家支付积分", "buyerPayCredits");
        map.put("总金额", "totalAmount");
        map.put("返点积分", "returnCredits");
        map.put("买家实际支付金额", "buyerActualPayAmount");
        map.put("买家实际支付积分", "buyerActualPayCredits");
        map.put("订单状态", "orderStatus");
        map.put("买家留言", "buyerMessage");
        map.put("收货人名称", "receiverName");
        map.put("收货地址", "recieverAddress");
        map.put("运送方式", "deliveryMethod");
        map.put("联系电话", "mobile");
        map.put("联系手机", "phone");
        map.put("虚拟号过期时间", "virtualNoExpireTime");
        map.put("订单创建时间", "orderCreateTime");
        map.put("订单付款时间", "orderPayTime");
        map.put("宝贝标题", "goodsTitle");
        map.put("宝贝种类", "goodsType");
        map.put("物流单号", "logisticsNo");
        map.put("物流公司", "logisticsCompany");
        map.put("订单备注", "remark");
        map.put("宝贝总数量", "goodsNum");
        map.put("店铺Id", "storeId");
        map.put("店铺名称", "storeName");
        map.put("订单关闭原因", "orderCloseReason");
        map.put("卖家服务费", "sellerServiceFee");
        map.put("买家服务费", "buyerServiceFee");
        map.put("发票抬头", "invoiceTitle");
        map.put("是否手机订单", "mobileOrder");
        map.put("分阶段订单信息", "stepOrderInfo");
        map.put("特权订金订单id", "privilegeOrderId");
        map.put("是否上传合同照片", "hasUploadContract");
        map.put("是否上传小票", "hasUploadReceipt");
        map.put("是否代付", "hasPayBehalf");
        map.put("定金排名", "depositRank");
        map.put("修改后的sku", "newSku");
        map.put("修改后的收获地址", "newRecieveAddress");
        map.put("异常信息", "exceptionMessage");
        map.put("天猫卡券抵扣", "tmallDeduct");
        map.put("集分宝抵扣", "jfbDeduct");
        map.put("是否是O2O交易", "o2oTrade");
        map.put("新零售交易类型", "newTradeType");
        map.put("新零售导购门店名称", "newTradeName");
        map.put("新零售导购门店id", "newTradeId");
        map.put("新零售发货门店名称", "newTradeDeliveryName");
        map.put("新零售发货门店id", "newTradeDeliveryId");
        map.put("退款金额", "returnAmount");
        map.put("预约门店", "bookingStore");
        map.put("确认收货时间", "receiveTime");
        map.put("打款商家金额", "paySellerAmount");
        map.put("含应开票给个人的个人红包", "invoiceTip");
        map.put("是否信用购", "hasCreditBuy");
        map.put("体验期结束时间", "experienceEndTime");
        map.put("前N有礼", "aheadPresent");
        map.put("配送类型", "deliveryType");
        map.put("直播返现状态", "liveReturnStatus");
        map.put("返现金额", "cashbackAmount");
        map.put("延迟发货赔付金额", "delayPayAmount");
        map.put("新零售成交门店昵称", "newDealStoreName");
        map.put("新零售成交门店id", "newDealStoreId");
        map.put("新零售成交经销商id", "newDealAgentId");
        map.put("预售订单", "presaleOrder");
        map.put("发货时间", "deliveryTime");
        map.put("主订单编号", "mainOrderNum");
        map.put("补差订单", "differentOrder");
        map.put("账单月份", "billMonth");
        return map;
    }
}
